package com.company.admin.controller.job.school;

import com.company.admin.common.annotations.VisitAble;
import com.company.admin.common.result.ResultResponse;
import com.company.admin.req.job.school.SchoolJobAddRequest;
import com.company.admin.req.job.school.SchoolJobDeleteRequest;
import com.company.admin.req.job.school.SchoolJobListRequest;
import com.company.admin.req.job.school.SchoolJobModifyRequest;
import com.company.admin.resp.job.school.SchoolJobListResponse;
import com.company.admin.service.job.school.SchoolJobService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @program: myProject
 * @description: ${description}
 * @author: zhaochenglin
 * @create: 2019-03-03 16:48
 **/
@RequestMapping("/job/school")
@Controller
public class SchoolJobController {

    @Autowired
    private SchoolJobService schoolJobService;

    @RequestMapping(value = "/add", method = RequestMethod.POST)
    @ResponseBody
    public ResultResponse<String> add(@RequestBody SchoolJobAddRequest request){
        schoolJobService.add(request);
        return ResultResponse.onSuccess("success", null);
    }

    @ResponseBody
    @RequestMapping(value = "/modify", method = RequestMethod.POST)
    public ResultResponse<String> modify(@RequestBody SchoolJobModifyRequest request){
        schoolJobService.modify(request);
        return ResultResponse.onSuccess("scuuess", null);
    }

    @ResponseBody
    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    public ResultResponse<String> delete (@RequestBody SchoolJobDeleteRequest request){
        schoolJobService.delete(request);
        return ResultResponse.onSuccess("success", null);
    }

    @VisitAble
    @ResponseBody
    @RequestMapping(value = "/list", method = RequestMethod.POST)
    public ResultResponse<SchoolJobListResponse> list (@RequestBody SchoolJobListRequest request){
        return ResultResponse.onSuccess(schoolJobService.list(request),null);
    }

}
